﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/Basic.Master" AutoEventWireup="true" CodeBehind="BottleTracking.aspx.cs" Inherits="PMS.UI.PM.BottleTracking" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            var height = $("#divTotal").height();
            var master = $("#master").height();
            var content = parseFloat(height) - parseFloat(master) - 30;
            $("#tbList").css("height", content);
        });
    </script>
    <script type="text/javascript">
        $(function () {
            $("#tbList").datagrid({
                url: '/Logic/PM/BottleProductionAjax.aspx?method=GetBottleTrackingList',
                loadMsg: '数据加载中请稍后……',
                fitColumns: false,
                pagination: true,
                queryParams: com.serializeSearchArray("form1"),
                rownumbers: true,
                idField: "ID",
                singleSelect: true,
                pageSize: 20,
                pageList: [20, 50, 100],
                striped: true,
                frozenColumns: [[
                    { field: 'ck', checkbox: true, width: 30 },
                    {
                        field: 'AnalyseRes', title: '审批状态', sortable: false, align: "center", width: 60,
                        formatter: function (value, row, index) {
                            return com.getArrayText([
                                { value: "0", text: "审批合格" },
                                { value: "1", text: "审批不合格" },
                                { value: "2", text: "未审批" }], value)
                        },
                        styler: function (value, row, index) {
                            if (value == "1") {
                                return 'color:red';
                            }
                        }
                    },
                {
                    field: 'State', title: '气瓶状态', sortable: true, align: "center", width: 60,
                    formatter: function (value, row, index) {
                        return com.getArrayText(StaticCombo.BottleState, value)
                    }
                },
                 {
                     field: 'PrintState', title: '打印状态', sortable: true, align: "center", width: 80,
                     formatter: function (value, row, index) {
                         return com.getArrayText(StaticCombo.PrintState, value)
                     }
                 },
                    {
                        field: 'ProductOrderCode', title: '生产订单号 ', align: "center", width: 100
                    },
                    {
                        field: 'CustomerName', title: '客户名 ', align: "center", width: 100,
                        formatter: function (value, row, index) {
                            //鼠标放在文本处自动显示tooltip
                            return '<span title=' + value + '>' + value + '</span>';
                        }
                    },
                    {
                        field: 'SerialCode', title: '流水号', sortable: true, align: "center", width: 80
                    },
                     {
                         field: 'BottleCode', title: '气瓶编号', sortable: true, align: "center", width: 80
                     },
                    {
                        field: 'BottleVolume', title: '气瓶规格(L)', sortable: true, align: "center", width: 80
                    }

                ]],
                columns: [[
                     {
                         field: 'QuotationDetailID', title: '产品ID', sortable: true, align: "center", width: 50
                     },
                     {
                         field: 'ProductName', title: '产品名称', sortable: true, align: "center", width: 100,
                         formatter: function (value, row, index) {
                             //鼠标放在文本处自动显示tooltip
                             return '<span title=' + value + '>' + value + '</span>';
                         }
                     },
                    {
                        field: 'TechParams', title: '技术参数', sortable: false, align: "center", width: 200,
                        formatter: function (value, row, index) {
                            //鼠标放在文本处自动显示tooltip
                            return '<span title=' + value + '>' + value + '</span>';
                        }
                    },
                     { field: 'FillDate', title: '投产日期', sortable: true, align: "center", width: 100 },
                     { field: 'CompletedDate', title: '配气完成日期', sortable: true, align: "center", width: 100 },
                     {
                         field: 'ProdUserName', title: '配气师', sortable: false, align: "center", width: 60
                     },
                     {
                         field: 'AnalyseDate', title: '分析日期', sortable: true, align: "center", width: 100
                     },
                      {
                          field: 'AnalyseUserName', title: '分析人', sortable: false, align: "center", width: 60
                      },

                     { field: 'InStorageDate', title: '入库日期', align: "center", width: 100 },
                     {
                         field: 'InStorageUserName', title: '入库人', sortable: false, align: "center", width: 60
                     },
                      { field: 'DeliveryDate', title: '发货日期', align: "center", width: 100 },
                     {
                         field: 'DeliveryUserName', title: '发货人', sortable: false, align: "center", width: 60
                     },
                     { field: 'DeliveryCode', title: '发货单号', align: "center", width: 100 },
                     { field: 'ReceiveAddress', title: '送货地址', align: "center", width: 120 },
                     {
                         field: 'QuotationCode', title: '报价单号 ', align: "center", width: 100
                     },
                     {
                         field: 'ContractCode', title: '合同单号 ', align: "center", width: 100
                     },
                     {
                         field: 'GBCode', title: '国标号 ', align: "center", width: 110
                     },
                     { field: 'Uncertainty', title: '不确定度', align: "center", width: 60 },
                      { field: 'QuotationDetailNote', title: '产品备注', sortable: false, align: "center", width: 60 },
                    {
                        field: 'Note', title: '备注', sortable: false, align: "center", width: 100
                    }
                ]],
                singleSelect: true,
                onDblClickRow: function (rowIndex, rowData) {
                    var url = "/UI/PM/BottleQueryScan.aspx?action=view&ID=" + rowData.ID;
                    top.wrapper.addTab("查看配气信息", url)
                }
            })
        })
    </script>
    <script type="text/javascript">

        //查询
        function funcSearch() {
            var para = com.serializeSearchArray("form1");
            $("#tbList").datagrid("load", para);
        }

        //重置
        function funcReload() {
            $("#form1").form("reset");
            var para = com.serializeSearchArray("form1");
            $("#tbList").datagrid("load", para);
        }

        //查看配气信息
        function funcDetail() {
            var row = $('#tbList').datagrid('getSelected');
            if (row) {
                var url = "/UI/PM/BottleQueryScan.aspx?action=view&ID=" + row.ID;
                top.wrapper.addTab("查看配气信息", url)
            } else {
                com.message("information", "请选中一行");
            }
        }


        //查看绑定气瓶信息
        function funcBind() {
            var row = $('#tbList').datagrid('getSelected');
            if (row) {
                var url = "/UI/PM/BindBottle.aspx?action=view&QuotDetailID=" + row.QuotationDetailID + "&ID=" + row.ID;
                top.wrapper.addTab("查看绑定气瓶信息", url)
            } else {
                com.message("information", "请选中一行");
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divTotal" style="height: 100%; width: 100%">
        <div id="master" class="container_16" style="height: auto">
            <form id="form1">
                <div class="grid_4 sealbl" style="text-align: right;">
                    气瓶编号 :
                    <input type="text" id="BottleCode" name="BottleCode" data-cp="co" />
                </div>
                <div class="grid_4 sealbl" style="text-align: right;">
                    气瓶状态 :
                    <input type="text" class="easyui-combobox" id="State" name="State" data-cp="=" data-options="valueField:'value',textField:'text',data:StaticCombo.BottleStateQuery,panelHeight:'auto'" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    生产单号 :
                    <input type="text" id="ProductOrderCode" name="ProductOrderCode" data-cp="co" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    客户名称 :
                    <input type="text" id="CustomerName" name="CustomerName" data-cp="co" />
                </div>
                <div class="clear"></div>
                <div class="grid_4 sealbl" style="text-align: right;">
                    投产时间从:
                    <input type="text" id="startFillDate" name="startFillDate" data-cp="str>=" class="easyui-datebox" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    到年月:
                    <input type="text" id="endFillDate" name="endFillDate" data-cp="str<=" class="easyui-datebox" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    产品名称 :
                    <input type="text" id="ProductName" name="ProductName" data-cp="co" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    流水号 :
                    <input type="text" id="SerialCode" name="SerialCode" data-cp="co" />
                </div>
                <div class="clear"></div>
                <div class="grid_4 sealbl" style="text-align: right;">
                    审批状态 :
                    <input type="text" class="easyui-combobox" id="AnalyseRes" name="AnalyseRes" data-cp="="
                        data-options="valueField:'value',textField:'text',
                        data:[{ value: '0', text: '审批合格' },
                                { value: '1', text: '审批不合格' },
                                { value: '2', text: '未审批' }],panelHeight:'auto'" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    报价单号 :
                    <input type="text" id="QuotationCode" name="QuotationCode" data-cp="co" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    合同单号 :
                    <input type="text" id="ContractCode" name="ContractCode" data-cp="co" />
                </div>
                <div class="grid_4 seaval" style="text-align: right;">
                    气瓶规格 :
                    <input type="text" id="BottleVolume" name="BottleVolume" data-cp="=" />
                </div>
            </form>
        </div>
        <table id="tbList" title="气瓶生产跟踪 " style="width: 100%">
        </table>

    </div>
</asp:Content>

